FROM golang:1.17-alpine

MAINTAINER PoorBoy 

# https://mirrors.tuna.tsinghua.edu.cn/alpine/latest-stable/main/
# RUN echo "https://mirrors.tuna.tsinghua.edu.cn/alpine/latest-stable/main/" > /etc/apk/repositories

RUN echo "https://mirrors.tuna.tsinghua.edu.cn/alpine/v3.15/main/" > /etc/apk/repositories


# 还可以设置不走 proxy 的私有仓库或组，多个用逗号相隔（可选）
#export GOPRIVATE=git.mycompany.com,github.com/my/private --no-cache
ENV GOPROXY https://goproxy.io,direct

RUN apk update \
    && apk upgrade \
    && apk add bash bash-completion tzdata git build-base 
    

RUN cp -r -f /usr/share/zoneinfo/Hongkong /etc/localtime \
    && rm -rf /var/cache/apk/* \
    && /bin/bash 

EXPOSE 8080

WORKDIR /mysrc

RUN go get -u github.com/beego/beego/v2
RUN go get -u github.com/beego/bee/v2
RUN go get -u github.com/cosmtrek/air

# echo "air -c .air.conf" >> "/opt/s"
# go mod verify  
# air -c .air.conf


# ADD s /opt/
# RUN chmod a+x /opt/s
 
# ENTRYPOINT ["/opt/s"]
CMD [ "top" ]